package com.example.sijia.mywidget;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

public class GeneralGestureActivity extends Activity {

    // This example shows an Activity, but you would use the same approach if
// you were subclassing a View.
    private float disXToP = 0f;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_general_gesture);

        Log.i("getLeft", findViewById(R.id.view).getLeft() + "");
        Log.i("getTranslationX", findViewById(R.id.view).getTranslationX() + "");
        Log.i("getX", findViewById(R.id.view).getX() + "");
    }


    public void move(View view) {
        findViewById(R.id.view).setX(disXToP + 10);
        disXToP = disXToP + 10;

        Log.i("getLeft", findViewById(R.id.view).getLeft() + "");
        Log.i("getTranslationX", findViewById(R.id.view).getTranslationX() + "");
        Log.i("getX", findViewById(R.id.view).getX() + "");

    }
}